%Returns data of channel given by channel_number
%uses number_channels function

function  data=data_channel(path,channel_number)

filename=[path '\data.h5'];
max_num_channels=number_channels(path);

if channel_number <= max_num_channels
    all_data=hdf5read(filename,'/y');
    data=all_data(:,channel_number);
else
    error(['You saved only ' num2str(max_num_channels) ' channels'])
    
end

    